/*** 
 * @Author: Yanan Chen
 * @Date: 2021-11-02 13:24:38
 * @LastEditTime: 2022-01-10 13:16:21
 * @LastEditors: Yanan Chen
 * @Description: 
 * @FilePath: \sadwinner\fw\esp32\Src\CFG\prj_cfg.h
 * @
 */

#ifndef PRJ_CFG_H
#define PRJ_CFG_H



//dev info
#ifdef PRJ_NAME
#define TerminalName PRJ_NAME
#else
#define TerminalName "ESP32"
#endif
#define BLE_DEV_NAME TerminalName
#define CONSOLE_MAX_COMMAND_LINE_LENGTH 50
#define DEF_WIFI_SSID   "Samsung"
#define DEF_WIFI_PASSWORD   "1234567899"


//hardware 

//ADC
#define POWER_ADC_CHANNEL ADC1_CHANNEL_0
//BUTTON
#define GPIO_INPUT_IO_KEY_UP        2
#define GPIO_INPUT_IO_KEY_DOWN      0
//PWM
#define PWM_PULSE_GPIO        (25)   // GPIO connects to the PWM signal line
//TOUCH_PAD
#define TOUCH_PAD_NUM_USER TOUCH_PAD_NUM8
//SPI DISPLAY
#define DIS_PIN_NUM_MISO 19
#define DIS_PIN_NUM_MOSI 23
#define DIS_PIN_NUM_CLK  18
#define DIS_PIN_NUM_CS_OLED   5
#define DIS_PIN_NUM_CS_EPAPER   4
#define DIS_PIN_NUM_DC   22
//SPI SD Card
#define SD_PIN_NUM_MISO 12
#define SD_PIN_NUM_MOSI 13
#define SD_PIN_NUM_CLK  14
#define SD_PIN_NUM_CS   15
#define SD_PIN_NUM_CHECK   39
//i2c
#define IIC_USER_NUM        I2C_NUM_0
#define IIC_SCL_PIN_NUM        27
#define IIC_SDA_PIN_NUM        26
#define IIC_USER_FREQUENCE     100000
//uart
#define UART_USER_NUM       UART_NUM_1
#define UART_TX_PIN_NUM     32   
#define UART_RX_PIN_NUM     35   

//thread cfg
#define MAIN_QUEUE_SIZE        20
#define OLED_QUEUE_SIZE        10

#define MAIN_STACK_SIZE           (4*1024)
#define MAIN_TASK_PRIO            (5)
#define MAIN_TASK_TIME            (10)

#define UI_STACK_SIZE           (20*1024)
#define UI_TASK_PRIO            (6)
#define UI_TASK_TIME            (10)
#define UI_LED_DELAY            (10)

#define WIFI_STACK_SIZE           (10*1024)
#define WIFI_TASK_PRIO            (7)
#define WIFI_TASK_TIME            (10)

#define BLE_STACK_SIZE           (10*1024)
#define BLE_TASK_PRIO            (8)
#define BLE_TASK_TIME            (10)


#define CLOUD_STACK_SIZE           (4*1024)
#define CLOUD_TASK_PRIO            (9)
#define CLOUD_TASK_TIME            (10)

#define SENSOR_STACK_SIZE           (4*1024)
#define SENSOR_TASK_PRIO            (10)
#define SENSOR_TASK_TIME            (10)

#endif


